home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / var / lib / dpkg / info / gdm3.postinst < prev    next >
Encoding:
Text File  |  2011-09-21  |  2.5 KB  |  92 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. . /usr/share/debconf/confmodule
  6.  
  7. THIS_PACKAGE=gdm3
  8. DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
  9.  
  10. # creating Debian-gdm group if it isn't already there
  11. if ! getent group Debian-gdm >/dev/null; then
  12.         addgroup --system --force-badname Debian-gdm
  13. fi
  14.  
  15. # creating Debian-gdm user if it isn't already there
  16. if ! getent passwd Debian-gdm >/dev/null; then
  17.         adduser --system --force-badname \
  18.             --ingroup Debian-gdm \
  19.             --home /var/lib/gdm3 \
  20.             --shell /bin/false \
  21.             Debian-gdm
  22.         usermod -c "Gnome Display Manager" Debian-gdm
  23. fi
  24.  
  25. # debconf is not a registry, so we only fiddle with the default file if it
  26. # does not exist
  27. if [ ! -e $DEFAULT_DISPLAY_MANAGER_FILE ]; then
  28.   if db_get shared/default-x-display-manager; then
  29.     # workaround debconf passthru bug (#379198)
  30.     if [ -z "$RET" ]; then
  31.       $RET="$THIS_PACKAGE"
  32.     fi
  33.     if [ "$THIS_PACKAGE" != "$RET" ]; then
  34.       echo "Please be sure to run \"dpkg --configure $RET\"."
  35.     fi
  36.     if db_get "$RET"/daemon_name; then
  37.       echo "$RET" > $DEFAULT_DISPLAY_MANAGER_FILE
  38.     fi
  39.   fi
  40. fi
  41. # debconf hangs if gdm3 gets started below without this
  42. db_stop || true
  43.  
  44. # update-rc.d levels
  45. S=30
  46. K=01
  47.  
  48. mkdir -p /var/lib/gdm3/.gconf.mandatory
  49. cat > /var/lib/gdm3/.gconf.path << "EOF"
  50. # System-wide settings set in /usr/share/gdm/greeter-config
  51. # and auto-generated by the init script
  52. xml:readonly:$(HOME)/.gconf.mandatory
  53. EOF
  54. chmod 0750 /var/lib/gdm3
  55. update-gconf-defaults \
  56.     --source=/usr/share/gdm/greeter-config \
  57.     --destination=/var/lib/gdm3/.gconf.mandatory \
  58.     --no-signal
  59. chown -R Debian-gdm:Debian-gdm /var/lib/gdm3
  60.  
  61. # Automatically added by dh_installmenu
  62. if [ "$1" = "configure" ] && [ -x "`which update-menus 2>/dev/null`" ]; then
  63.     update-menus
  64. fi
  65. # End automatically added section
  66.  
  67.  
  68. if [ -f /var/run/gdm.pid ]; then
  69.   # We are probably upgrading from the old GDM version
  70.   old_pid=$(cat /var/run/gdm.pid)
  71.   if [ -L /proc/"$old_pid"/exe ] && [ $(readlink /proc/"$old_pid"/exe | awk '{print $1}') = /usr/sbin/gdm ]; then
  72.     # Paint me ugly: when you reload GDM 2.20, it will re-execute itself
  73.     # when possible. This means we need a temporary /usr/sbin/gdm that
  74.     # will delete itself (so that the old /etc/init.d/gdm becomes again
  75.     # a no-op).
  76.     cat > /usr/sbin/gdm << EOF
  77. #! /bin/sh
  78. rm -f /usr/sbin/gdm
  79. exec /usr/sbin/gdm3 "\$@"
  80. EOF
  81.     chmod 755 /usr/sbin/gdm
  82.     kill -s USR1 "$old_pid" || true
  83.   fi
  84. fi
  85.  
  86. if [ -x /etc/init.d/gdm3 ]; then
  87.   update-rc.d gdm3 defaults $S $K >/dev/null 2>&1
  88.   invoke-rc.d gdm3 reload || true
  89. fi
  90.  
  91. exit 0
  92.